Skip to main content

Working with AQL

Running AQL queries

To run a query, connect to the desired database and call aql.execute(). This returns a cursor, which lets you fetch the results in batches. You can iterate over the cursor to automatically fetch the data.

# Run a query
cursor = db.aql.execute('FOR i IN 1..@value RETURN i', bind_vars={'value': 3})

# Print the results
for doc in cursor:
print(doc)
 
Help us improve

Anything unclear or buggy in this tutorial? Provide Feedback